package day03;
//赋值运算符
public class OperDemo4 {
    public static void main(String[] args) {
        //4. 赋值运算符: =,+=,-=,*=,/=,%=
        int a=5;
        a+=10;//a=(int)(a+10)
        System.out.println(a);//15
        a*=2;//a=(int)(a*2)
        System.out.println(a);//30
        a/=5;//a=(int)(a/5)
        System.out.println(a);//6

        //面试小题
        short s=5;//5本身是int 类型,可以直接赋值给byte,char,short
        //s=s+10;//编译错误,因为s+10是int类型
        s+=10;//s=(short)(s+10)
        System.out.println(s);
        System.out.println("我今年1万岁了:"+s);
    }
}
